home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kshortcutdialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.6 KB  |  97 lines

  1. /* This file is part of the KDE libraries
  2.     Copyright (C) 2002,2003 Ellis Whitehead <ellis@kde.org>
  3.  
  4.     This library is free software; you can redistribute it and/or
  5.     modify it under the terms of the GNU Library General Public
  6.     License as published by the Free Software Foundation; either
  7.     version 2 of the License, or (at your option) any later version.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef _KSHORTCUTDIALOG_H_
  21. #define _KSHORTCUTDIALOG_H_
  22.  
  23. #include "kdialogbase.h"
  24. #include "kshortcut.h"
  25.  
  26. class QVBox;
  27. class KPushButton;
  28. class KShortcutDialogSimple;
  29. class KShortcutDialogAdvanced;
  30.  
  31. /**
  32.  * @short Dialog for configuring a shortcut.
  33.  *
  34.  * This dialog allows configuring a single KShortcut. KKeyDialog
  35.  * should be usually used instead.
  36.  *
  37.  * @internal
  38.  * @see KKeyDialog
  39.  * @since 3.4
  40.  */
  41. class KDEUI_EXPORT KShortcutDialog : public KDialogBase
  42. {
  43.     Q_OBJECT
  44. public:
  45.     KShortcutDialog( const KShortcut& shortcut, bool bQtShortcut, QWidget* parent = 0, const char* name = 0 );
  46.     ~KShortcutDialog();
  47.  
  48.     void setShortcut( const KShortcut & shortcut );
  49.     const KShortcut& shortcut() const { return m_shortcut; }
  50.  
  51. private:
  52.     // true if qt shortcut, false if native shortcut
  53.     bool m_bQtShortcut;
  54.  
  55.     KShortcut m_shortcut;
  56.     bool m_bGrab;
  57.     KPushButton* m_ptxtCurrent;
  58.     uint m_iSeq;
  59.     uint m_iKey;
  60.     bool m_bRecording;
  61.     uint m_mod;
  62.     KShortcutDialogSimple *m_simple;
  63.     KShortcutDialogAdvanced *m_adv;
  64.     QVBox *m_stack;
  65.     
  66.     void updateShortcutDisplay();
  67.     //void displayMods();
  68.     void keyPressed( KKey key );
  69.     void updateDetails();
  70.  
  71.     #ifdef Q_WS_X11
  72.     virtual bool x11Event( XEvent *pEvent );
  73.     //void x11EventKeyPress( XEvent *pEvent );
  74.     void x11KeyPressEvent( XEvent* pEvent );
  75.     void x11KeyReleaseEvent( XEvent* pEvent );
  76.     #endif
  77.     #ifdef Q_WS_WIN
  78.     virtual void keyPressEvent( QKeyEvent * e );
  79.     virtual bool event(QEvent * e);
  80.     #endif
  81.  
  82. protected slots:
  83.     void slotDetails();
  84.     void slotSelectPrimary();
  85.     void slotSelectAlternate();
  86.     void slotClearShortcut();
  87.     void slotClearPrimary();
  88.     void slotClearAlternate();
  89.     void slotMultiKeyMode( bool bOn );
  90.  
  91. private:
  92.         class KShortcutDialogPrivate* d;
  93.         static bool s_showMore;
  94. };
  95.  
  96. #endif // _KSHORTCUTDIALOG_H_
  97.